package com.game.worm.mobile.view.tags;

import android.app.Activity;

import com.game.worm.mobile.view.tags.bean.TagBean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by d_xxiang on 2018/5/22.
 */

public class TagHelper {

    private Activity activity;

    public TagHelper(Activity activity) {
        this.activity = activity;
    }

    public void setData(List<TagBean> tags){
        List<Integer> indexs = new ArrayList<>();
        Map<Integer,List<TagBean>> map = new HashMap<>();
        for (TagBean tagBean : tags){

            if (!indexs.contains(tagBean.getParentId())){
                indexs.add(tagBean.getParentId());
                List<TagBean> list = new ArrayList<>();
                map.put(tagBean.getParentId(),list);
            }
            map.get(tagBean.getParentId()).add(tagBean);
        }
        Collections.sort(indexs);
    }


}
